<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <title>社团列表</title>
    <!-- 新 Bootstrap 核心 CSS 文件 -->
    <link rel="stylesheet" href="http://cdn.bootcss.com/bootstrap/3.3.5/css/bootstrap.min.css">

    <!-- 可选的Bootstrap主题文件（一般不用引入） -->
    <link rel="stylesheet" href="http://cdn.bootcss.com/bootstrap/3.3.5/css/bootstrap-theme.min.css">

    <!-- jQuery文件。务必在bootstrap.min.js 之前引入 -->
    <script src="http://cdn.bootcss.com/jquery/1.11.3/jquery.min.js"></script>

    <!-- 最新的 Bootstrap 核心 JavaScript 文件 -->
    <script src="http://cdn.bootcss.com/bootstrap/3.3.5/js/bootstrap.min.js"></script>

    <link rel="stylesheet" href="/css/font-awesome.css">
    <link rel="stylesheet" href="/css/base.css">
    <link rel="stylesheet" href="/css/djs.css">

    <script src="/js/user.js"></script>
    <script type="text/javascript" src="/js/base.js"></script>

    <script src="/json/CityJson.js" type="text/javascript" charset="utf-8"></script>
    <script src="/json/ProJson.js" type="text/javascript" charset="utf-8"></script>
    <script src="/json/DistrictJson.js" type="text/javascript" charset="utf-8"></script>
</head>
<body>
<div id="top">

</div>
<div class="container">
    <div id="asideAffix" class="aside" data-spy="affix">
    </div>
    <div class="centers content editcontent" style="margin-top: 0;">
        <form role="form" id="editForm" class="form-horizontal">
            <div class="form-group">
                <div class="col-sm-12">
                    <label for="mobile" class="col-sm-2">手机号码：</label>
                    <!--<input type="text" id="groupCode" readonly required class="col-sm-4">-->
                    <label id="mobile" class="col-sm-6"></label>
                </div>

                <div class="col-sm-12">
                    <label for="cardNo" class="col-sm-2">身份证号：</label>
                    <!--<input type="text" id="name" readonly required class="col-sm-4">-->
                    <label id="cardNo" class="col-sm-6"></label>
                </div>

                <div class="col-sm-12">
                    <label for="realName" class="col-sm-2">真实姓名：</label>
                    <!--<input type="text" id="shortName" readonly required class="col-sm-4">-->
                    <label id="realName" class="col-sm-6"></label>
                </div>


                <div class="col-sm-12">
                    <label for="nickName" class="col-sm-2">用户昵称：</label>
                    <!--<input type="text" id="monitor" readonly required class="col-sm-4">-->
                    <label id="nickName" class="col-sm-6"></label>
                </div>
                <div class="col-sm-12">
                    <label for="job" class="col-sm-2">用户职业：</label>
                    <!--<input type="text" id="phone" readonly required class="col-sm-4">-->
                    <label id="job" class="col-sm-6"></label>
                </div>
                <div class="col-sm-12">
                    <label for="skill" class="col-sm-2">专业技能：</label>
                    <label id="skill" class="col-sm-2"></label>
                </div>
                <div class="col-sm-12">
                    <label for="serviceField" class="col-sm-2">服务领域：</label>
                    <!--<input type="text" id="serviceField" readonly required class="col-sm-4">-->
                    <label id="serviceField" class="col-sm-6"></label>
                </div>
                <div class="col-sm-12">
                    <label for="sign" class="col-sm-2">个人签名：</label>
                    <!--<input type="text" id="codeImg" readonly required class="col-sm-4">-->
                    <!--<label id="codeImg" class="col-sm-6"></label>-->
                    <label id="sign" class="col-sm-6"></label>
                </div>
                <div class="col-sm-12">
                    <label for="headUrl" class="col-sm-2">个人头像：</label>
                    <!--<input type="text" id="demo" readonly required class="col-sm-4">-->

                    <img id="headUrl" class="col-sm-6" src="">
                </div>

            </div>
            <div>
                <button type="button" class="col-sm-2 btn btn-primary" id="rollback"
                        style="border-color: #ffd632;background: #ffd632 linear-gradient(to bottom,#ffd632 0,#ffd632 100%);">
                    返回
                </button>
            </div>
        </form>
    </div>
</div>
</body>

<script type="text/javascript">
    var groupId;
    $(
            function () {
                if (location.search.substr(1).split("&")[0].split("=")[1] != undefined && location.search.substr(1).split("&")[0].split("=")[1] != 0) {
                    setData(location.search.substr(1).split("&")[0].split("=")[1]);
                    setGroupId(location.search.substr(1).split("&")[1].split("=")[1]);
                }
            }
    );

    function setGroupId(value) {
        groupId = value;
    }

    function setProvince(selValue) {
        $.each(province, function (k, p) {
            if (p.ProID == selValue) {
                var option = "<option value='" + p.ProID + "'>" + p.ProName + "</option>";
                $("#selDistrict").append(option);
            }
        });
    }

    function setCity(selValue) {
        $.each(province, function (k, p) {
            if (p.ProID == selValue) {
                var option = "<option value='" + p.CityID + "'>" + p.CityName + "</option>";
                $("#selDistrict").append(option);
            }
        });
    }

    function setDistrict(selValue) {
        $.each(province, function (k, p) {
            if (p.ProID == selValue) {
                var option = "<option value='" + p.Id + "'>" + p.DisName + "</option>";
                $("#selDistrict").append(option);
            }
        });
    }

    function setData(volunteerId) {
        $.ajax({
            url: '/volunteer/info',// 跳转到 action
            headers: {'Content-type': 'application/json;charset=UTF-8'},//传入数据数据格式 json
            data: JSON.stringify({
                id: volunteerId
            }),
            type: 'post',
            cache: false,
            dataType: 'json',
            success: function (data) {
                if (data.statusCode == 0) {
                    $("#mobile").text(data.data.mobile);
                    $("#cardNo").text(data.data.cardNo);
                    $("#realName").text(data.data.realName);
                    $("#nickName").text(data.data.nickName);
                    $("#job").text(data.data.job);
                    $("#skill").text(data.data.skill);
                    $("#serviceField").text(data.data.serviceField);
                    $("#sign").text(data.data.sign);
                    $("#headUrl").attr('src', data.data.headUrl);

                } else {
                    alert(data.statusMessage);
                }
            },
            error: function () {
                // view("异常！");
                alert("用户未登录或者服务器连接异常！");
                location.href = "/html/login/login.html";
            }
        });
    }

    $("#rollback").click(function () {
        back()
    });

    function back() {
        location.href = "/html/group/groupVolunteerList.html?groupId=" + groupId;
    }
</script>
</html>